﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Iterator_Pattern
{
    public class SongsOfThe70s : SongIterator
    {
        public List<SongInfo> bestSongs;

        public SongsOfThe70s()
        {
            bestSongs = new List<SongInfo>();
            addSong("Imagine", "John Lennon", 1971);
            addSong("American Pie", "Don McLean", 1971);
            addSong("I Will Survive", "Gloria Gaynor", 1971);
        }

        public void addSong(String songName, String bandName, int yearReleased)
        {
            SongInfo songInfo = new SongInfo(songName, bandName, yearReleased);

            bestSongs.Add(songInfo);
        }

        public IEnumerator createIterator()
        {
            return bestSongs.GetEnumerator();
        }
    }
}
